Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 9 - Movie Data Exchange Components


Using Movie Data Exchange Components

This section discusses how applications use movie data exchange components. You should read this section if you are writing an application that uses these components or if you are creating one of these components.

Importing and Exporting Movie Data

Your application starts a data import or export operation by calling the Movie Toolbox. There are several Movie Toolbox functions that allow you to specify a data import or data export component. For example, the PasteHandleIntoMovie and ConvertFileToMovieFile functions allow you to specify a movie data import component. The PutMovieIntoTypedHandle and ConvertMovieToFile functions allow you to specify a movie data export component. All of these functions select a component for you if you do not specify one yourself. For more information about these functions, see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime.

When you import data into a QuickTime movie, you can specify that the data be placed into a specific existing track in the movie, into a new track that is created by the movie data import component, or into one or more existing tracks (in this case, the component may create additional tracks, if necessary).

When you export data from a QuickTime movie, you can request data from a specific track or from the entire movie. In addition, you can specify a segment of the track or movie to be exported.

Configuring a Movie Data Exchange Component

You do not need to configure a movie data exchange component before you use it to convert data into or out of a QuickTime movie. These components are implemented in such a way that they can operate successfully using their own default configuration information. In fact, some data exchange components do not allow you to configure them. However, most data exchange components do support some or all of the configuration functions that are defined for components of this type.

If you are going to configure a data exchange component, you must do so before you start the data exchange operation. You must call the component directly in order to set the configuration--the Movie Toolbox does not do this for you. Use the functions described in "Configuring Movie Data Import Components" and "Configuring Movie Data Export Components," as appropriate. Note that all of these functions are optional; that is, it is up to the developer of the component to decide whether or not to support a given configuration function. If the component does not support a function you have called, the component returns an error code of badComponentSelector.

Finding a Specific Movie Data Exchange Component

If you are going to specify a particular data exchange component to the Movie Toolbox, you must first open a connection to that component. Use the Component Manager's OpenDefaultComponent or OpenComponent function to open a connection to a





movie data exchange component (see the chapter "Component Manager" in Inside Macintosh: More Macintosh Toolbox for more information about these functions). Before you can open that connection, however, you must find an appropriate movie data exchange component.

To find an appropriate data exchange component, you may need to use the
Component Manager's FindNextComponent function. You specify the characteristics of the component you are seeking in a component description record--in particular, in the componentType, componentSubtype, componentManufacturer, and componentFlags fields.

Movie data import components have a component type value of 'eat ', which is defined by the MovieImportType constant. Movie data export components have a type value of 'spit', which is defined by the MovieExportType constant.

Movie data exchange components use their component subtype and manufacturer values to indicate the type of data that they support. The subtype value indicates the type of data that these components can import or export. For example, movie data import components that convert text into QuickTime movie data have a component subtype value of 'TEXT'. A single data exchange component may support only one
data type.

The manufacturer field indicates the QuickTime media type that is supported by the component. For example, movie data export components that can read data from a sound media have a manufacturer value of 'soun' (this value is defined by the SoundMediaType constant). If a data exchange component can work with more than one media type, it specifies a manufacturer value of 0.

In addition, these components use the componentFlags field to indicate more specific information about their capabilities. The following flags are currently defined:

enum {
   canMovieImportHandles         = 1,  /* can import from 
                                          handles */
   canMovieImportFiles           = 2,  /* can import from files */
   hasMovieImportUserInterface   = 4,  /* import has user
                                          interface */
   canMovieExportHandles         = 8,  /* can export to handles */
   canMovieExportFiles           = 16, /* can export to files */
   hasMovieExportUserInterface   = 32, /* export has user
                                          interface */
   dontAutoFileMovieImport       = 64  /* turn off automatic file
                                          conversion */
};
Movie data import components use the first three flags to specify their capabilities. If
a component can convert data from a handle, its canMovieImportHandles flag is set to 1. If it can work with files, its canMovieImportFiles flag is set to 1. Note that both of these flags may be set to 1 if a single component can work with both files and handles. If a component provides a dialog box that allows the user to specify configuration information, the hasMovieImportUserInterface flag is set to 1. If a component does not support the automatic conversion of standard files to movies in an import component, set the dontAutoFileMovieImport flag to 1 (the default setting is 0).

Movie data export components use the other three flags in the same way.


Subtopics
Importing and Exporting Movie Data
Configuring a Movie Data Exchange Component
Finding a Specific Movie Data Exchange Component

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help